How to resolve $ is not defined